package com.saxon.mybatis_plus.hander;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.util.Date;
@Component
@Slf4j
public class MyMybatishandle implements MetaObjectHandler {
    @Override
    public void insertFill (MetaObject metaObject) {
        log.info ("enter ....");
        this.strictInsertFill (metaObject,"createTime", Date.class,new Date ());
    }

    @Override
    public void updateFill (MetaObject metaObject) {
        this.strictUpdateFill (metaObject,"ModifyTime", Date.class,new Date ());

    }
}
